import Taro, { Component } from '@tarojs/taro'
import { View, Text, Navigator } from '@tarojs/components'
import { AtDivider } from 'taro-ui'
import './NewsItem.scss'

export default class NewsItem extends Component {

  render () {
    let {url,title,time,source} = this.props //获取父组件传递过来的对象（url、title、time）
    url = url + '&title='+title+'&time='+time+'&source='+source;
    return (
    <Navigator  className='news_item' url={url}> 
      <View className='news_title_and_only_two'>{title}</View>
      <View className='news_info'>
        <View className='news_info_time'>
          <View className='time_icon'></View>
          <View className='time_content'>{time}</View>
        </View>
      <View className='news_info_source'>{source}</View>
      </View>
    </Navigator>
    )
  }
}
